1. Field of the Invention
The invention relates in general to an apparatus for accessing data stored in a storage medium. More particularly, this invention relates to, an apparatus for accessing data stored on an optical disc.
2. Description of the Related Art
In recent years, the CD-ROM storage system has been speedily developed in both application and techniques. In terms of operation speed, from the early model of single speed, the current model has been developed with more than fifty times of the single speed. The capacity has also been increased from 650 Mega-byte to 4 Giga-Byte. Nowadays, the DVD plays a more and more important role. Currently, the DVD-ROM has approached a quad-speed. According to the development of CD-ROM, a DVD-ROM with a much higher speed is foreseeable. In addition to the operation speed, the performance of a DVD-ROM includes the capability of data accessing. That is, when the disk contains scratches or other defects, the DVD-ROM can still access the data of the disk precisely.
A brief description for accessing data of a DVD is introduced as follows.
In a DVD, an original data of 2048 bytes are stored in a data sector. FIG. 1 displays the format for storing data in each of the data sector. From FIG. 1, each data sector comprises twelve rows of data. ID 102 having a length of 4 bytes is a number sequentially increasing according to the order of the data sectors. The identification error detection code (IEDC) 104 having a length of 2 bytes is used as data protection of the ID 102. The copyright management information (CPR13MAI) 106 with a length of 6 bytes is used to store the data related to copyright. The main data with a total length of 2048 bytes is shown in FIG. 1 as well. After the scramble operation of ID 102, the main data are stored in the main data segment 108, 110, 112, 114˜426, 128 to 130 in sequence.
In addition to store data of 160 bytes in the main data segment 108, and to store data of 168 bytes in the main data segment 130, each of the rest of the main data segments from 110, 112, 114˜426 to 128 stores data of 172 bytes. A sum of these data stored in the main data segments 108, 110, 112, 114˜126, 128 to 130 is 2048 bytes (D0–D2047).
In the last row of FIG. 1, that is, the row comprises the data segment 130, there is an error detection code (EDC) 132 with a length of 4 bytes. This error detection code 132 is obtained according to the data of 2060 bytes stored in the ID 102, the IDEC 104, the CPR_MAI 106 and the main data segments 108 to 130. Therefore, the total length of a data sector is 2064 bytes.
To protect the data stored in a data sector, in a DVD, 16 data sectors, that is, 192 rows of data are treated as a unit encoded into an ECC block according to Reed Solomon Product Code (RSPC). As shown in FIG. 2A, data of 192 rows times 172 bytes, that is, data b0,0 to b191, 171 are assembled according to the sequence of the data in the data sector. Referring to FIG. 2B, each of the 172 data columns is encoded by RS(208, 192, 17) according to RSPC, so that an outer-code parity (PO) data with a length of 16 bytes is added to each column as the 16 column of PO data b192, 0 to b207, 171.
After generating the PO data, the whole sector of data is shown as FIG. 2C. The whole sector comprises 208 rows of data, and each row of data is encoded by RS(182, 172, 11) to add inner-code parity (PI) data with a length 10 bytes in each column, that is, the data b0, 172 to b0, 181 to the data b207, 172 to b207, 181. The added PI data comprises data of 208 rows times 10 bytes. The ECC block is thus assembled.
FIG. 2D shows the data storage configuration in a DVD disk. As shown in the figure, in the end of each data sector, a segment of PO data is added, while the PI data are added right after each row of the data sector. For example, after each of the twelve rows of the 0th data sector 210, a 10 byte PI data is added. After the 0th data sector 210 and before the first data sector 220, a PO0 data 215 is added. It is similar to the first sector 220, the second sector 230 until the 15th sector 240. A PO1 data 225, a PO2 data 235 . . . , a PO15 data 245 are respectively added between the data sectors 220, 230, . . . and, 240.
FIG. 3A shows a structure for accessing data of a DVD, and FIG. 3B shows a flow chart for accessing data of the DVD. In FIG. 3A, an analog signal read from the disk 310 by the reading head 311 is converted into a digital EFM data 313 by an analog signal processor 312. Being demodulated by the EFMPLUS demodulator 314, the EFM data 313 becomes the row data 315 in a unit of bytes. According to the ID of the row data 315, the row data interface 316 stores the required sector data to the memory 321 under the control of the memory controller 320. While the data stored into the memory 321 by the row data interface 316 can be assembled as an ECC block, the RSPC decoder 317 accesses the data stored in the memory 321 via the memory controller 320 to decode of PI data and PO data, so as to correct the error data.
Each time when the RSPC decoder 317 finishes decoding PI data and PO data in an ECC block, the error detection code processor 318 accesses the data stored in the memory 321 via the memory controller 321. The error detection code in each sector of the 16 data sectors in the ECC block is calculated. If all the error detection codes are correct, the host interface 319 descrambles and send the main data to the host 322. If any of the 16 error detection codes is incorrect, there are two ways to process. One is to repeat decoding the PI and PO data by the RSPC decoder 317 once, followed by re-calculating the new error detection codes by the EDC processor 318 until all the error detection codes are correct. The other way is to access the ECC block by re-read the disk 310 by the reading head 311. Through the same flow, the error detection codes are re-calculated until all the error detection codes are correct.
According to the above description, the accessing times for memory 321 can be obtained from the flow chart of FIG. 3B. In step S330, after performing the EFMPLUS demodulation, the required sequential steps comprise: writing data into the memory 321 by the row data interface 316 in step S331; decoding PI data and PO data using RSPC decoder 317 and performing correction in steps S332 and S333; calculating the error detection codes in step S334; and sending the data to the host 322 in step S335. Thus, the steps to access the memory 321 comprise writing the memory 321 in step 331; reading the memory 321 in steps S332, S333, S334 and S335; and correcting the memory in steps S332 and S333.
Therefore, a calculation for the flow of the data can be presented as:
Each time when reading in an ECC block, a total amount of (192+16)×(172+10)=38038 bytes is to be written into the memory (as shown in FIG. 2C).
In step S332, while decoding the PI data, an amount of (192+16)×(172+10)=38038 bytes are to be read.
In step S333, while decoding the PO data, an amount of (192+16)×172=35776 bytes are to be read.
In step S334, while calculating the error detection codes, 16 data sectors are to be read. Each data sector is of 2064 bytes, so that the total amount is 16×2064=33024 bytes.
When sending the data to the host 322 in step S335, the required-amount of the data is 16×2048=32768 bytes.
In step S332 and S333, as the accessed memory for correction of the PI data and PO data is negligible, therefore, the amount is not calculated.
According to the above calculation, when the host obtains the data of 16×2048 (that is, 32768) bytes, at least 177624 bytes of the memory are accessed. By the definition of DVD specification, a single speed for data transferring of a DVD is 1.385 Mbytes/sec. That is, for a single speed, the data accessing amount for the memory is 1.385×177624/32768=7.507 Mbytes/sec. Therefore, when the DVD approaches twelve times of speed, the data accessing speed is 90 Mbytes/sec, and it is 120 Mbytes/sec for a sixteen times speed.
With regard to the design of DVD, a memory with a length of a 16 bit data bus is used as the memory 321 as shown in FIG. 3A. Since the length of the data bus is 16 bit, so that 2 bytes can be accessed each time. In addition, while accessing each set of memory data, for an SDRAM, a clock cycle has to be exceeded. Therefore, for a 16 times speed DVD-ROM, according to the conventional design, an SDRAM of 120 MHz is required. The memory with a higher frequency connotes a higher cost and larger power consumption. In addition, as the signal is in high frequency, the difficulty of system design is increased.
Thus, the conventional design for accessing data of DVD comprises the following drawbacks:
1. The access amount for memory is massy to affect the speed for accessing data of DVD. As the high frequency devices are required, the cost is increased, and the power consumption is raised. Furthermore, it is difficult to design;
2. The method for correcting the errors of error detection code during decoding consumes a lot of resources by re-reading. For re-decoding procedure, the over-all speed for accessing the data of DVD is also degraded. Therefore, it cannot meet the high speed requirement.